package com.wwtech.epp.ui.activity.work.module;

import com.wwtech.epp.data.api.HttpAPIWrapper;
import com.wwtech.epp.ui.activity.base.ActivityScope;
import com.wwtech.epp.ui.activity.work.DailyFragment;
import com.wwtech.epp.ui.activity.work.contract.DailyContract;
import com.wwtech.epp.ui.activity.work.presenter.DailyPresenter;
import com.wwtech.epp.ui.adapter.work.AttachmentAdapter;
import com.wwtech.epp.ui.adapter.work.DailyListAdapter;

import java.util.ArrayList;

import dagger.Module;
import dagger.Provides;

/**
 * @author hzp
 * @Package com.wwtech.epp.ui.activity.work
 * @Description: The moduele of DailyFragment, provide field for DailyFragment
 * @date 2017/12/07 17:36:20
 */
@Module
public class DailyModule {
    private final DailyContract.View mView;


    public DailyModule(DailyContract.View view) {
        this.mView = view;
    }

    @Provides
    @ActivityScope
    public DailyPresenter provideDailyPresenter(HttpAPIWrapper httpAPIWrapper, DailyFragment mFragment) {
        return new DailyPresenter(httpAPIWrapper, mView, mFragment);
    }

    @Provides
    @ActivityScope
    public DailyFragment provideDailyFragment() {
        return (DailyFragment) mView;
    }

    @Provides
    public DailyListAdapter provideDailyListAdapter() {
        return new DailyListAdapter(new ArrayList<>());
    }

}